import { BrowserModule } from '@angular/platform-browser';
import { NgModule, Component } from '@angular/core';
import { HttpClientModule }    from '@angular/common/http';
import { FormsModule } from '@angular/forms'; // <-- NgModel lives here
import { RouterModule, Routes } from '@angular/router';
import { AppComponent } from './app.component';
import { ConfigService } from './service/config.service';
import { NewsService } from './service/news.service';
import { NewslistComponent } from './news/newslist/newslist.component';
import { EditComponent } from './news/edit/edit.component';
import { CKEditorModule } from 'ng2-ckeditor';
import { TohtmlPipe } from './pipe/tohtml.pipe';
import { DetailComponent } from './news/detail/detail.component';
import { NewslistforuserComponent } from './news/newslistforuser/newslistforuser.component';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
import { NgbCarouselConfig } from '@ng-bootstrap/ng-bootstrap';
import { ForshowComponent } from './carousel/forshow/forshow.component';
import { UploadComponent } from './carousel/upload/upload.component';
import { IndexComponent } from './bs/index/index.component';
import { EidtcarouselComponent } from './carousel/eidtcarousel/eidtcarousel.component';
import { CarouselService } from './service/carousel.service';
import { SinglepagelistComponent } from './singlepage/singlepagelist/singlepagelist.component';
import { EditsinglepageComponent } from './singlepage/editsinglepage/editsinglepage.component';
import { UploadpageComponent } from './singlepage/uploadpage/uploadpage.component';
import { SinglepageService } from './service/singlepage.service';

export const ROUTES: Routes = [
  {path:'newslist',component:NewslistComponent},
  {path:'editnews/:id',component:EditComponent},
  {path:'detail/:id',component:DetailComponent},
  {path:'newslistforuser',component:NewslistforuserComponent},
  {path:'showcarousel',component:ForshowComponent},
  {path:'uploadfile',component:UploadComponent},
  {path:'index',component:IndexComponent},
  {path:'eidtCarousel/:id',component:EidtcarouselComponent},
  {path:'eidtcarousel',component:EditComponent},
  {path:'singlepagelist',component:SinglepagelistComponent},
  {path:'editsinglepage/:id',component:EditsinglepageComponent},
  {path:'editsinglepage',component:EditsinglepageComponent},
  {path:'uploadpage',component:UploadpageComponent},
  {path:'**',component:IndexComponent}
];

@NgModule({
  declarations: [
    AppComponent,
    NewslistComponent,
    EditComponent,
    TohtmlPipe,
    DetailComponent,
    NewslistforuserComponent,
    ForshowComponent,
    UploadComponent,
    IndexComponent,
    EidtcarouselComponent,
    SinglepagelistComponent,
    EditsinglepageComponent,
    UploadpageComponent
  ],
  imports: [
    BrowserModule,
    HttpClientModule,
    FormsModule,
    RouterModule.forRoot(ROUTES),
    CKEditorModule,
    NgbModule
  ],
  providers: [
    ConfigService,
    NewsService,
    NgbCarouselConfig,
    CarouselService,
    SinglepageService
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
